import request from '@/utils/request'


// 条件分页查询出版社列表
export function search(query, current = 1, size = 20) {
  return request({
    url: `/press/search`,
    method: 'post',
    data: {...query, current, size}
  })
}

// 新增出版社
export function add( data ) {
  return request({
    url: `/press`,
    method: 'post',
    data
  })
}

// 查询出版社信息
export function getById( id ) {
  return request({
    url: `/press/${id}`,
    method: 'get'
  })
}

// 更新
export function update( data ) {
  return request({
    url: `/press`,
    method: 'put',
    data
  })
}

// 删除
export function deleteById(id) {
  return request({
    url: `/press/${id}`,
    method: 'delete'
  })
}
